package com.jl.card;

import opencard.core.terminal.CommandAPDU;
import opencard.core.terminal.ResponseAPDU;

public interface ICard {


	/**
	 * open a card and connect
	 * @return
	 */
	public boolean open();

	/**
	 * close a card
	 * @return
	 */
	public boolean close();
	
	/**
	 * reconnect
	 * @return
	 */
	public boolean reconnect();
	
	/**
	 * reset
	 * @param worm
	 * @return
	 */
	public byte[] reset(boolean worm);

	/**
	 * send a apdu
	 * @param cmd
	 * @return
	 */
	public byte[] plainAPDU(String cmd);
	
	/**
	 * sendCommandAPDU
	 * @param capdu
	 * @return
	 */
	public ResponseAPDU sendCommandAPDU(CommandAPDU capdu);
	
	/**
	 * verify command, base on provider
	 * @param type
	 * @param value
	 * @return
	 */
	public boolean verify(int type,String value);
	/**
	 * set card provider
	 * @param provider
	 * @throws ReflectiveOperationException
	 */
	public void setProvider(String provider)throws ReflectiveOperationException;
	/**
	 * get the card name
	 * @return
	 */
	public String getName();
	
	/**
	 * check the card is connect
	 * @return
	 */
	public boolean isConnect();

}
